package com.tiwi.gmbdr.constant;

import java.util.ArrayList;
import java.util.List;

import com.tiwi.gmbdr.OpenHelper.QuestionOpenHelper;
import com.tiwi.gmbdr.OpenHelper.UserOpenHelper;

public class DBTablesSql {
	private static StringBuilder TBL_USER_SQL;
	private static StringBuilder TBL_QUESTION_SQL;

	
	static {
		TBL_USER_SQL = new StringBuilder("CREATE TABLE IF NOT EXISTS ")
				.append(UserOpenHelper.TABLE_NAME).append(" (")
				.append(UserOpenHelper.NO_USER).append(" TEXT, ")
				.append(UserOpenHelper.NAMA_USER).append(" TEXT, ")
				.append(UserOpenHelper.SKOR).append(" TEXT ").append(");");

		TBL_QUESTION_SQL = new StringBuilder("CREATE TABLE IF NOT EXISTS ")
				.append(QuestionOpenHelper.TABLE_NAME).append(" (")
				.append(QuestionOpenHelper.NO_SOAL)
				.append(" INTEGER PRIMARY KEY, ")
				.append(QuestionOpenHelper.SOAL).append(" TEXT, ")
				.append(QuestionOpenHelper.GAMBAR).append(" IMAGE, ")
				.append(QuestionOpenHelper.JAWABAN_A).append(" TEXT, ")
				.append(QuestionOpenHelper.JAWABAN_B).append(" TEXT, ")
				.append(QuestionOpenHelper.JAWABAN_C).append(" TEXT, ")
				.append(QuestionOpenHelper.JAWABAN_D).append(" TEXT, ")
				.append(QuestionOpenHelper.JAWABAN_E).append(" TEXT, ")
				.append(QuestionOpenHelper.KUNCI_JAWABAN).append(" TEXT ")
				.append(");");

}
	public static List<String> getAllTableStructureSql() {
		List<String> list = new ArrayList<String>();
		list.add(TBL_USER_SQL.toString());
		list.add(TBL_QUESTION_SQL.toString());
		return list;
	}
	
	public static List<String> getUserTableStructureSql(){
		List<String> list = new ArrayList<String>();
		list.add(TBL_USER_SQL.toString());
		return list;
	}
}
